package cn.ittaoli.movie.service;

import cn.ittaoli.movie.dao.SlideMapper;
import cn.ittaoli.movie.dao.SlideMapperCustomer;
import cn.ittaoli.movie.model.Slide;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by lub_lenovo on 2017/11/6.
 */
@Service
public class SlideService {
    @Autowired
    private SlideMapper slideMapper;

    @Autowired
    private SlideMapperCustomer slideMapperCustomer;

    public Integer insert(Slide slide) {
        slide.setInserttime(System.currentTimeMillis());
        slide.setLastupdatetime(System.currentTimeMillis());
        return slideMapper.insert(slide);
    }

    public List<Slide> getAll() {
        return slideMapperCustomer.getAll();
    }
}
